const {
    Controller
} = require('uni-cloud-router')
module.exports = class FileController extends Controller {
    constructor(ctx) {
        super(ctx)
    }
	
    async delete() {
		let {
			id
		} = this.ctx.data
		if (!id) {
			return {
				code: 400,
				message: '参数错误'
			}
		}
        try{
        	await this.service.system.file.delete({
        		id
        	})
			return {
				code: 200,
				message: '删除成功'
			}
        }catch(e){
        	return {
        		code: 500,
        		message: e.message
        	}
        }
    }
}
